package rps.client;

import rps.game.Game;
import rps.game.data.Figure;
import rps.game.data.Player;

public interface GCtoUIInterface {
	/**
	 * Indicates that the UI should now show the GamePane.
	 */
	public void switchToGamePane();

	/**
	 * Is called when a new game starts	
	 * @param game Board
	 * @param opponent The Player's Opponent
	 */
	public void startGame(Game game, Player opponent);

	/**
	 * Is called when it's necessary to update the playing board.
	 * @param field The current field of figures.
	 */
	public void updateBoard(Figure[] field);

	/**
	 * Is called by GameProvider when the game finally starts (initial choice
	 * and assignment have been submitted successfully). This will tell the user
	 * that the game is now in progress but doesn't necessarily mean that the
	 * user will start the game.
	 */
	public void gameStarted();

	/**
	 * Is called by GameProvider after an initial choice draw has occurred. This
	 * will reenable the initial choice panel.
	 */
	public void initialChoiceDraw();
	
	/**
	 * Is called by GameProvider when a message is received.
	 * @param sender The sender player.
	 * @param message The message text.
	 */
	public void receivedMessage(Player sender, String message);

	/**
	 * Is called by GameProvider when this player is requested to provide a next
	 * move. This will enable the playing board.
	 */
	public void provideNextMove();

	/**
	 * Is called by GameProvider when a figure is moved.
	 * @param fromIndex The field index the moving figure started at.
	 * @param toIndex The field index the moving figure came to.
	 */
	public void figureMoved(int fromIndex, int toIndex, Figure[] newField);

	/**
	 * Is called by GameProvider when a figure is attacked.
	 * @param fromIndex The field index the attacking figure came from.
	 * @param toIndex The field index where the fight happened.
	 * @param attackingFigure The figure of the attacker (stores the attacker).
	 * @param defendingFigure The figure of the defender (stores the defender).
	 */
	public void figureAttacked(int fromIndex, int toIndex, Figure attackingFigure, Figure defendingFigure, Figure[] newField);

	/**
	 * Is called by game provider when a Figure of the same type
	 * was attacked and the Player has to choose RPS.
	 * Enables WeaponChoicePane.
	 */
	public void provideChoiceAfterFightIsDrawn();

	/**
	 * Is called by GameProvider when the player lost the game. This will
	 * disable the playing board and request a restart.
	 */
	public void gameIsLost();

	/**
	 * Is called by GameProvider when the player won the game. This will
	 * disable the playing board and request a restart.
	 */
	public void gameIsWon();

	/**
	 * Is called by GameProvider when the game finishes drawn. This will
	 * disable the playing board and request a restart.
	 */
	public void gameIsDrawn();

}
